package com.mj.securitycode.service;

import java.util.Date;

import com.mj.securitycode.util.HttpUtils;

/**
 * 防伪查询
 * @author zhaominglei
 * @date 2015-11-19
 * 
 */
public class SecuritycodeService extends BaseService {
	@SuppressWarnings("unused")
	private static final String TAG = SecuritycodeService.class.getSimpleName();
	private static final String CHINA315_URL = "http://www.china3-15.com/Module/QueryCode.ashx"; //china3-15
	
	public String getSecuritycodeInfo(String securitycode) {
		String queryURL = CHINA315_URL+"?type=cn_query&code="+securitycode+"&_="+new Date().getTime();
		String html = HttpUtils.doGetForChina315(queryURL, null);
		if (html != null && !html.equals("") && html.indexOf("ResultInfo") > -1) {
			return html.substring(html.indexOf("\"ResultInfo\":\"")+"\"ResultInfo\":\"".length(), html.indexOf("\"}"));
		}
		return null;
	}
}
